package uk.ac.glasgow.demosocs.impl.ui;

import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Date;

import uk.ac.glasgow.clui.SystemCommandException;

public class DateUtil {
	private static SimpleDateFormat df = new SimpleDateFormat("d/M/y HH:mm");
	
	public static Date parseArgumentDate(String day, String time) throws SystemCommandException {
		String dateString = day+" "+time;
		try {
			return df.parse(dateString);
		} catch (ParseException e) {
			throw new SystemCommandException("Couldn't parse date string: ["+dateString+"]");
		}
	}
}
